Skip to content

feat: implement microservices offline sync manager (Close #373)#607

Merged
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
shadrach68:offline-capacities
May 30, 2026
Merged

feat: implement microservices offline sync manager (Close #373)#607
RUKAYAT-CODER merged 1 commit into
rinafcode:mainfrom
shadrach68:offline-capacities

Conversation

@shadrach68
Copy link
Copy Markdown
Contributor

Description

Implements Microservices-aware Offline Capabilities for the TeachLink frontend to improve the user experience under flaky network conditions. This introduces the OfflineSyncManager utility which caches mutations (POST, PUT, DELETE) locally when the network drops and intelligently routes them to the correct backend microservice (Auth, Courses, Groups, etc.) when connectivity is restored.

Changes

  • ✅ Created src/lib/offline/OfflineSyncManager.ts to handle offline queuing and routing.
  • ✅ Added comprehensive unit tests in src/lib/offline/__tests__/OfflineSyncManager.test.ts.
  • ✅ Created OFFLINE_MICROSERVICES_SUMMARY.md with architectural documentation and integration instructions.

Features

  • Microservice Routing: Routes queued requests to specific domain APIs.
  • Durable Queue: LocalStorage-backed request queuing ensures data survives browser refreshes.
  • Chronological Processing: Requests are processed in the order they were generated when connectivity returns.
  • Graceful Degradation: Maintains data integrity by halting the queue if a microservice endpoint errors upon reconnection.

Testing

  • Unit tests written mocking localStorage, navigator.onLine, and fetch.
  • Verified offline enqueuing behavior.
  • Verified correct microservice URL resolution upon online synchronization.
  • Status: 100% tests passing ✅

Checklist

  • Code follows project coding standards
  • All tests pass
  • No regression in existing functionality
  • Documentation is complete
  • Performance impact is minimal

Related Issues

Closes #373

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 30, 2026

@shadrach68 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit 03a6c55 into rinafcode:main May 30, 2026
1 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security Offline Capabilities : Microservices Architecture

2 participants